<?php

class Search_Model
{

private $gender;
private $ageFrom;
private $ageTo;
private $name;


    public function __construct(array $arr = null)
    {  
        if (is_array($arr)){
              $prop = $this->getArray();
              foreach($arr  as $k=>$v){
              if (array_key_exists($k, $prop) == true){
                    $this->$k = $v;
                    }
              }
        }   
    }
    
    public function getGender()
    {
        return $this->gender  ;
    }
    
    public function setGender($gender)
    {
       $this->gender = $gender   ;
       return $this; 
    }
    
    public function getAgeFrom()
    {   
        return $this->ageFrom;
    }
    
    public function setAgeFrom($ageFrom)
    {   
        
       $this->ageFrom = $ageFrom ;
       return $this; 
    }
    
    public function getAgeTo()
    {
        return $this->ageTo  ;
    }
    
    public function setAgeTo($ageTo)
    {
       $this->ageTo = $ageTo ;
       return $this; 
    }
    
    public function getName()
    {
        return $this->name  ;
    }
    
    public function setName($name)
    {
       $this->name = $name   ;
       return $this; 
    }
 
    
    public function getArray()
    {
        $objArr = get_object_vars($this);
        return $objArr;
    }
}